< previous page page_30 next page >

Page 30
Run the application and click the UpDown buttons to see what happens. Don't forget that you can still use this control like the old Spin control by using the UpClick and DownClick event routines.
ImageCombo..
The ImageCombo control is the newest of the list style controls and is very similar to a standard Windows ComboBox control with some interesting variations. The most visible difference is the ability to include pictures with each item in the list portion of the combo, making it easier for the user to identify and choose items from a list of possible selections. Another important difference is the way the ImageCombo manages the list portion of the control. Each item in the list is a ComboItem object, and the list itself is really a collection of ComboItem object. This makes it easy to access items individually or collectively, and assign or change the properties that determine item content and appearance.
Each item in the ImageCombo list can have three pictures associated with it, as defined by the following properties.
Note
Because the items in the list are objects in a collection, several of the properties found in the standard combo box (such as
List, ListIndex, and ItemData) are no longer required.

ImageAppears in the drop-down portion of the control next to the text of the list item.
SelImageSpecifies the picture used when an item has been selected from the list.
OverlayImageProvides a way to overlay an image on top of the main image, such as a check mark or an X indicating an item is unavailable.
The images themselves are defined and stored in the ImageList control and are assigned to items by using an index or key value that references a picture stored in the ImageList control. Working with the ImageCombo control is very similar to the ListView and TreeView controls. To see how to use the ImageCombo, add an ImageCombo and an ImageList control to the demo form as shown in Figure 1.18, removing any other controls and associated code.

 
< previous page page_30 next page >

If you like this book, buy it!